
<%--<%@ page contentType="text/html;charset=UTF-8" language="java" %>--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <style>
        /* 全局样式重置 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Arial', sans-serif;
            /* 背景图设置，与注册页保持一致，假设图片放在项目的images目录下，根据实际调整路径 */
            background: url('https://tse1-mm.cn.bing.net/th/id/OIP-C.62ldstqXOT3z4aLkucEuSgHaE8?w=277&h=185&c=7&r=0&o=5&dpr=1.3&pid=1.7') no-repeat center center fixed;
            -webkit-background-size: cover;
            -moz-background-size: cover;
            -o-background-size: cover;
            background-size: cover;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
        }

        .login-box {
            background-color: rgba(255, 255, 255, 0.92);
            padding: 40px 50px;
            border-radius: 15px;
            box-shadow: 0 0 30px rgba(0, 0, 0, 0.25);
            width: 450px;
        }

        h1 {
            text-align: center;
            color: #2c3e50;
            margin-bottom: 35px;
            font-size: 28px;
        }

        label {
            display: block;
            margin-bottom: 12px;
            color: #34495e;
            font-size: 16px;
            font-weight: 500;
        }

        input[type="text"],
        input[type="password"] {
            width: 100%;
            padding: 14px;
            margin-bottom: 25px;
            border: 1px solid #bdc3c7;
            border-radius: 8px;
            font-size: 16px;
            transition: border-color 0.3s ease;
        }

        input[type="text"]:focus,
        input[type="password"]:focus {
            border-color: #3498db;
            outline: none;
            box-shadow: 0 0 8px rgba(52, 152, 219, 0.3);
        }

        input[type="submit"] {
            background-color: #3498db;
            color: #ffffff;
            padding: 16px 32px;
            border: none;
            border-radius: 10px;
            font-size: 18px;
            cursor: pointer;
            transition: background-color 0.3s ease;
            width: 100%;
        }

        input[type="submit"]:hover {
            background-color: #2980b9;
        }

        p {
            color: #e74c3c;
            margin-top: 15px;
            text-align: center;
            font-size: 15px;
        }

        a {
            display: block;
            margin-top: 30px;
            color: #3498db;
            text-decoration: none;
            text-align: center;
            font-size: 16px;
            transition: color 0.3s ease;
        }

        a:hover {
            color: #2980b9;
            text-decoration: underline;
        }
    </style>
</head>
<body>
<div class="login-box">
    <form action="login" method="post">
        <h1>欢迎登录</h1>
        <label for="username">用户名：</label>
        <input type="text" id="username" name="username" required>
        <label for="password">密码：</label>
        <input type="password" id="password" name="password" required>
        <input type="submit" value="登录">
    </form>
    <% String error = request.getParameter("error");
        if (error != null) { %>
    <p><%= error %></p>
    <% } %>
    <a href="register.jsp">没有账号？注册</a>
</div>
</body>
</html>